import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL), // h5 history路由
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/Home.vue'),
      meta: {
        isshowtabbar: true
      },
      children: [// 二级路由
        {
          path: 'searchpopup',
          name: 'searchpopup',
          component: () => import('@/views/Searchpopup.vue'),
          meta: {
            isshowtabbar: false
          },
        }
      ]
    },
    {
      path: '/topic',
      name: 'topic',
      component: () => import('@/views/Topic.vue'),
      meta: {
        isshowtabbar: true
      }
    },
    {
      path: '/category',
      name: 'category',
      component: () => import('@/views/Category.vue'),
      meta: {
        isshowtabbar: true
      }
    },
    {
      path: '/car',
      name: 'car',
      component: () => import('@/views/Car.vue'),
      meta: {
        isshowtabbar: true
      }
    },
    {
      path: '/mine',
      name: 'mine',
      component: () => import('@/views/Mine.vue'),
      meta: {
        isshowtabbar: true
      }
    },
    {
      path: '/channel/:id',
      name: 'channel',
      component: () => import('@/views/Channel.vue'),
      meta: {
        isshowtabbar: false
      }
    },
    {
      path: '/detail',
      name: 'detail',
      component: () => import('@/views/Detail.vue'),
      meta: {
        isshowtabbar: false
      }
    }

  ]
})

export default router
